<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
    
<% 
 Double totalCnt = (Double)request.getAttribute("totalCnt");
%>
<jsp:useBean id="boardVO" class="org.ddr.board.vo.BoardVO" scope="request"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <style type="text/css">
 
.list_table {width:100%}
.list_table tbody td { text-align: center;  border-bottom: 1px solid #e5e5e5; padding: 5px; 
font-size:10pt;}
a { text-decoration:none }
 </style>
</head>
<body>
  <table class="list_table" width="600">
  <h2>
  <caption >3조 게시판</caption>
  </h2>
  <colgroup>
   <col width="15%" />
   <col width="35%" />
   <col width="15%" />
   <col width="15%" />
   <col width="20%" />
   
  </colgroup> 
  <tbody>
  <tr>
   <th> 글번호 </th>
   <th> 제목 </th>
   <th> 작성자 </th>
   <th> 조회수</th>
   <th> 날짜</th>
  </tr>
  <tr height="4" bgcolor="#e5e5e5"><td colspan="12">
  </tr>
  <c:forEach items = "${list }" var = "boardVO" >  
  <tr>
   <td>${boardVO.bbsNo }</td>
   <td style="text-align:left"><a href="webcontent/views/bbs/boardcontent.jsp?bbsno=${boardVO.bbsNo }" >${boardVO.title }(${boardVO.replyCount })</a></td>
   <td>${boardVO.userId }</td>
   <td>${boardVO.readCount }</td>
   <td>${boardVO.writeDate }</td>
  </tr>
  </c:forEach>
 </table> 
 <table align=center>
  <tr>
   <td align=center>
   <%   String pageno = (String)request.getAttribute("pageno");   
     Integer checkPage = (int)(Math.ceil((Double.parseDouble(pageno)/10))*100+1);
     for(int i=(checkPage/10)-9; i<(totalCnt/10) + 1; i++) {
     out.write ("[<a href = '/bbs/list.jsp?pageno="+i+"'>"+i+"</a>]");
     }
   %>
   </td>
  </tr>
  <tr>
   <td align=center>
       <a href = "bbs/write">글쓰기</a>
      </td>
  </tr>
 </table>
</body>
</html>